	PROGRAM CURTEST
C *** LAST REVISED ON 15-MAR-1988 09:01:48.39
C *** SOURCE FILE: [DL.GRAPHICS.LONGLIB]CURTEST.FOR
C
C	THIS PROGRAM IS DESIGNED TO TEST THE CURSOR ROUTINES.
C	WHILE THE PROGRAM WILL EXCERCISE ALL CURSOR ROUTINES, MANY
C	TERMINALS WILL WORK ONLY WITH A SUBSET OF THEM.  SOME ROUTINES
C	MAY EVEN LOCK TERMINAL UP.  CHECK DOCUMENTATION AND EXPERIMENT.
C
	DIMENSION XX(4),YY(4)
C
C	OPEN PLOT PACKAGE WITH SCREEN DEVICE PROMPT
C
	CALL FRAME(-3,0,0.,0.,1.)
C
C	SET RAMTEK CURSOR USAGE TO BE RAMTEK
C
	IDEV=0
C
C	PLOT A BACKGROUND TO SEE THE EFFECTS OF MOVING THE CURSOR MARKS
C	OVER AN EXISTING PLOT
C
	CALL RECT(1.,1.,5.,5.)
	CALL RECT(2.,2.,4.,4.)
	CALL PLOT(0.,0.,5)
C
C	FIRST TEST CURSOR MARK ROUTINE
C	WE ADD A FEW CURSOR MARKS
C
	CALL CTERM(1)
	WRITE (*,1)
1	FORMAT(' PLACE 4 CURSOR MARKS USING CURLOCATE')
	CALL CTERM(1)
C
	XX(1)=3.
	YY(1)=3.
	XX(2)=3.
	YY(2)=3.+2.
	XX(3)=3.+2.
	YY(3)=3.+2.
	XX(4)=3.+2.
	YY(4)=3.
	DO 10 I=1,4
		CALL CURLOCATE(XX(I),YY(I),I,IDEV)
10	CONTINUE
C
C	NOW TEST GETCURSOR
C
	CALL CTERM(1)
	WRITE (*,3)
3	FORMAT(' NOW TEST GETCURSOR--MOVE CURSOR AND TERMINATE GIN')
	CALL CTERM(1)
	X=4.
	Y=4.
	CALL GETCURSOR(X,Y,IKEY,ARESX,ARESY)
	CALL CTERM(1)
	WRITE (*,4) X,Y,IKEY
4	FORMAT(' GETCURSOR RETURNED (',F6.3,',',F6.3,') KEY=',I3
     $		/' TRY ONE MORE TIME')
	CALL CTERM(1)
	CALL GETCURSOR(X,Y,IKEY,ARESX,ARESY)
	CALL CTERM(1)
	WRITE (*,5) X,Y,IKEY
5	FORMAT(' GETCURSOR RETURNED (',F6.3,',',F6.3,') KEY=',I3)
	CALL CTERM(1)
C
C	DELETE CURSOR MARKS
C
	CALL CTERM(1)
	WRITE (*,2)
2	FORMAT(' NOW REMOVE THE 4 CURSOR MARKS USING CURLOCATE')
	CALL CTERM(1)
	DO 20 I=1,4
		CALL CURLOCATE(XX(I),YY(I),-I,IDEV)
20	CONTINUE
C
C	NOW TEST CURMOTION
C
	CALL CTERM(1)
	WRITE (*,13)
13	FORMAT(' NOW TEST CURMOTION--MOVE CURSOR AND TERMINATE GIN')
	CALL CTERM(1)
	X=4.
	Y=4.
	CALL CURMOTION(X,Y,IFLAG,ARESX,ARESY)
	CALL CTERM(1)
	WRITE (*,14) X,Y,IFLAG
14	FORMAT(' CURMOTION RETURNED (',F6.3,',',F6.3,') FLAG=',I3
     $		/' TRY ONE MORE TIME')
	CALL CTERM(1)
	CALL CURMOTION(X,Y,IFLAG,ARESX,ARESY)
	CALL CTERM(1)
	WRITE (*,15) X,Y,IFLAG
15	FORMAT(' CURMOTION RETURNED (',F6.3,',',F6.3,') FLAG=',I3)
	CALL CTERM(1)
C
C	NOW TEST CURBAND
C
	CALL CTERM(1)
	WRITE (*,23)
23	FORMAT(' NOW TEST CURBAND--MOVE CURSOR AND TERMINATE GIN')
	CALL CTERM(1)
	X=4.
	Y=4.
	X1=X-2.
	X2=X+2.
	Y1=Y+2.
	Y2=Y+2.
	CALL CURBAND(X,Y,IFLAG,ARESX,ARESY,X1,Y1,X2,Y2)
	CALL CTERM(1)
	WRITE (*,24) X,Y,IFLAG
24	FORMAT(' CURBAND RETURNED (',F6.3,',',F6.3,') FLAG=',I3
     $		/' TRY ONE MORE TIME')
	CALL CTERM(1)
	CALL CURBAND(X,Y,IFLAG,ARESX,ARESY,X1,Y1,X2,Y2)
	CALL CTERM(1)
	WRITE (*,25) X,Y,IFLAG
25	FORMAT(' CURBAND RETURNED (',F6.3,',',F6.3,') FLAG=',I3)
	CALL CTERM(1)
C
C	NOW TEST CURRECT
C
	CALL CTERM(1)
	WRITE (*,33)
33	FORMAT(' NOW TEST CURRECT--MOVE CURSOR AND TERMINATE GIN')
	CALL CTERM(1)
	X=4.
	Y=4.
	X1=X-2.
	X2=X+2.
	Y1=Y-2.
	Y2=Y+2.
	CALL CURRECT(X,Y,IFLAG,ARESX,ARESY,X1,Y1,X2,Y2)
	CALL CTERM(1)
	WRITE (*,34) X,Y,IFLAG
34	FORMAT(' CURRECT RETURNED (',F6.3,',',F6.3,') FLAG=',I3
     $		/' TRY ONE MORE TIME')
	CALL CTERM(1)
	CALL CURRECT(X,Y,IFLAG,ARESX,ARESY,X1,Y1,X2,Y2)
	CALL CTERM(1)
	WRITE (*,25) X,Y,IFLAG
35	FORMAT(' CURRECT RETURNED (',F6.3,',',F6.3,') FLAG=',I3)
	CALL CTERM(1)
C
C	ALL DONE WITH TEST
C
	CALL CTERM(2)
	CALL PLOTND
	STOP
	END
